package net.ymate.wechat.model;

import net.ymate.platform.core.beans.annotation.PropertyState;
import net.ymate.platform.persistence.IShardingable;
import net.ymate.platform.persistence.annotation.Default;
import net.ymate.platform.persistence.annotation.Entity;
import net.ymate.platform.persistence.annotation.Id;
import net.ymate.platform.persistence.annotation.Property;
import net.ymate.platform.persistence.jdbc.IConnectionHolder;
import net.ymate.platform.persistence.jdbc.support.BaseEntity;

/**
 * WechatAccount generated By EntityGenerator on 2017/08/18 上午 09:39:09
 *
 * @author YMP
 * @version 1.0
 */
@Entity("wechat_account")
public class WechatAccount extends BaseEntity<WechatAccount, java.lang.String> {

    private static final long serialVersionUID = 1L;

    @Id
    @Property(name = "id", nullable = false, length = 32)
    @PropertyState(propertyName = "id")
    private java.lang.String id;

    @Property(name = "name", nullable = false, length = 50)
    @PropertyState(propertyName = "name")
    private java.lang.String name;

    @Property(name = "account_id", nullable = false, length = 32)
    @PropertyState(propertyName = "account_id")
    private java.lang.String accountId;

    @Property(name = "app_id", nullable = false, length = 50)
    @PropertyState(propertyName = "app_id")
    private java.lang.String appId;

    @Property(name = "app_secret", nullable = false, length = 100)
    @PropertyState(propertyName = "app_secret")
    private java.lang.String appSecret;

    @Property(name = "app_aes_key", length = 50)
    @PropertyState(propertyName = "app_aes_key")
    private java.lang.String appAesKey;

    @Property(name = "last_app_aes_key", length = 50)
    @PropertyState(propertyName = "last_app_aes_key")
    private java.lang.String lastAppAesKey;

    @Property(name = "redirect_uri", length = 255)
    @PropertyState(propertyName = "redirect_uri")
    private java.lang.String redirectUri;

    @Property(name = "token", nullable = false, length = 32)
    @PropertyState(propertyName = "token")
    private java.lang.String token;

    @Property(name = "type", unsigned = true, length = 2)
    @Default("0")
    @PropertyState(propertyName = "type")
    private java.lang.Integer type;

    @Property(name = "is_verified", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_verified")
    private java.lang.Integer isVerified;

    @Property(name = "is_deleted", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_deleted")
    private java.lang.Integer isDeleted;

    @Property(name = "is_default", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_default")
    private java.lang.Integer isDefault;

    @Property(name = "is_msg_encrypted", unsigned = true, length = 1)
    @Default("0")
    @PropertyState(propertyName = "is_msg_encrypted")
    private java.lang.Integer isMsgEncrypted;

    @Property(name = "status", unsigned = true, length = 2)
    @Default("0")
    @PropertyState(propertyName = "status")
    private java.lang.Integer status;

    @Property(name = "site_id", nullable = false, length = 32)
    @PropertyState(propertyName = "site_id")
    private java.lang.String siteId;

    @Property(name = "remark", length = 200)
    @PropertyState(propertyName = "remark")
    private java.lang.String remark;

    @Property(name = "create_time", nullable = false, length = 13)
    @PropertyState(propertyName = "create_time")
    private java.lang.Long createTime;

    @Property(name = "last_modify_time", length = 13)
    @Default("0")
    @PropertyState(propertyName = "last_modify_time")
    private java.lang.Long lastModifyTime;

    /**
     * 构造器
     */
    public WechatAccount() {
    }

    /**
     * 构造器
     *
     * @param id
     * @param name
     * @param accountId
     * @param appId
     * @param appSecret
     * @param token
     * @param siteId
     * @param createTime
     */
    public WechatAccount(java.lang.String id, java.lang.String name, java.lang.String accountId, java.lang.String appId, java.lang.String appSecret, java.lang.String token, java.lang.String siteId, java.lang.Long createTime) {
        this.id = id;
        this.name = name;
        this.accountId = accountId;
        this.appId = appId;
        this.appSecret = appSecret;
        this.token = token;
        this.siteId = siteId;
        this.createTime = createTime;
    }

    /**
     * 构造器
     *
     * @param id
     * @param name
     * @param accountId
     * @param appId
     * @param appSecret
     * @param appAesKey
     * @param lastAppAesKey
     * @param redirectUri
     * @param token
     * @param type
     * @param isVerified
     * @param isDeleted
     * @param isDefault
     * @param isMsgEncrypted
     * @param status
     * @param siteId
     * @param remark
     * @param createTime
     * @param lastModifyTime
     */
    public WechatAccount(java.lang.String id, java.lang.String name, java.lang.String accountId, java.lang.String appId, java.lang.String appSecret, java.lang.String appAesKey, java.lang.String lastAppAesKey, java.lang.String redirectUri, java.lang.String token, java.lang.Integer type, java.lang.Integer isVerified, java.lang.Integer isDeleted, java.lang.Integer isDefault, java.lang.Integer isMsgEncrypted, java.lang.Integer status, java.lang.String siteId, java.lang.String remark, java.lang.Long createTime, java.lang.Long lastModifyTime) {
        this.id = id;
        this.name = name;
        this.accountId = accountId;
        this.appId = appId;
        this.appSecret = appSecret;
        this.appAesKey = appAesKey;
        this.lastAppAesKey = lastAppAesKey;
        this.redirectUri = redirectUri;
        this.token = token;
        this.type = type;
        this.isVerified = isVerified;
        this.isDeleted = isDeleted;
        this.isDefault = isDefault;
        this.isMsgEncrypted = isMsgEncrypted;
        this.status = status;
        this.siteId = siteId;
        this.remark = remark;
        this.createTime = createTime;
        this.lastModifyTime = lastModifyTime;
    }

    @Override
    public java.lang.String getId() {
        return id;
    }

    @Override
    public void setId(java.lang.String id) {
        this.id = id;
    }


    /**
     * @return the name
     */
    public java.lang.String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(java.lang.String name) {
        this.name = name;
    }

    /**
     * @return the accountId
     */
    public java.lang.String getAccountId() {
        return accountId;
    }

    /**
     * @param accountId the accountId to set
     */
    public void setAccountId(java.lang.String accountId) {
        this.accountId = accountId;
    }

    /**
     * @return the appId
     */
    public java.lang.String getAppId() {
        return appId;
    }

    /**
     * @param appId the appId to set
     */
    public void setAppId(java.lang.String appId) {
        this.appId = appId;
    }

    /**
     * @return the appSecret
     */
    public java.lang.String getAppSecret() {
        return appSecret;
    }

    /**
     * @param appSecret the appSecret to set
     */
    public void setAppSecret(java.lang.String appSecret) {
        this.appSecret = appSecret;
    }

    /**
     * @return the appAesKey
     */
    public java.lang.String getAppAesKey() {
        return appAesKey;
    }

    /**
     * @param appAesKey the appAesKey to set
     */
    public void setAppAesKey(java.lang.String appAesKey) {
        this.appAesKey = appAesKey;
    }

    /**
     * @return the lastAppAesKey
     */
    public java.lang.String getLastAppAesKey() {
        return lastAppAesKey;
    }

    /**
     * @param lastAppAesKey the lastAppAesKey to set
     */
    public void setLastAppAesKey(java.lang.String lastAppAesKey) {
        this.lastAppAesKey = lastAppAesKey;
    }

    /**
     * @return the redirectUri
     */
    public java.lang.String getRedirectUri() {
        return redirectUri;
    }

    /**
     * @param redirectUri the redirectUri to set
     */
    public void setRedirectUri(java.lang.String redirectUri) {
        this.redirectUri = redirectUri;
    }

    /**
     * @return the token
     */
    public java.lang.String getToken() {
        return token;
    }

    /**
     * @param token the token to set
     */
    public void setToken(java.lang.String token) {
        this.token = token;
    }

    /**
     * @return the type
     */
    public java.lang.Integer getType() {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(java.lang.Integer type) {
        this.type = type;
    }

    /**
     * @return the isVerified
     */
    public java.lang.Integer getIsVerified() {
        return isVerified;
    }

    /**
     * @param isVerified the isVerified to set
     */
    public void setIsVerified(java.lang.Integer isVerified) {
        this.isVerified = isVerified;
    }

    /**
     * @return the isDeleted
     */
    public java.lang.Integer getIsDeleted() {
        return isDeleted;
    }

    /**
     * @param isDeleted the isDeleted to set
     */
    public void setIsDeleted(java.lang.Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    /**
     * @return the isDefault
     */
    public java.lang.Integer getIsDefault() {
        return isDefault;
    }

    /**
     * @param isDefault the isDefault to set
     */
    public void setIsDefault(java.lang.Integer isDefault) {
        this.isDefault = isDefault;
    }

    /**
     * @return the isMsgEncrypted
     */
    public java.lang.Integer getIsMsgEncrypted() {
        return isMsgEncrypted;
    }

    /**
     * @param isMsgEncrypted the isMsgEncrypted to set
     */
    public void setIsMsgEncrypted(java.lang.Integer isMsgEncrypted) {
        this.isMsgEncrypted = isMsgEncrypted;
    }

    /**
     * @return the status
     */
    public java.lang.Integer getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(java.lang.Integer status) {
        this.status = status;
    }

    /**
     * @return the siteId
     */
    public java.lang.String getSiteId() {
        return siteId;
    }

    /**
     * @param siteId the siteId to set
     */
    public void setSiteId(java.lang.String siteId) {
        this.siteId = siteId;
    }

    /**
     * @return the remark
     */
    public java.lang.String getRemark() {
        return remark;
    }

    /**
     * @param remark the remark to set
     */
    public void setRemark(java.lang.String remark) {
        this.remark = remark;
    }

    /**
     * @return the createTime
     */
    public java.lang.Long getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(java.lang.Long createTime) {
        this.createTime = createTime;
    }

    /**
     * @return the lastModifyTime
     */
    public java.lang.Long getLastModifyTime() {
        return lastModifyTime;
    }

    /**
     * @param lastModifyTime the lastModifyTime to set
     */
    public void setLastModifyTime(java.lang.Long lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }


    //
    // Chain
    //

    public static WechatAccountBuilder builder() {
        return new WechatAccountBuilder();
    }

    public WechatAccountBuilder bind() {
        return new WechatAccountBuilder(this);
    }

    public static class WechatAccountBuilder {

        private WechatAccount _model;

        public WechatAccountBuilder() {
            _model = new WechatAccount();
        }

        public WechatAccountBuilder(WechatAccount model) {
            _model = model;
        }

        public WechatAccount build() {
            return _model;
        }


        public IConnectionHolder connectionHolder() {
            return _model.getConnectionHolder();
        }

        public WechatAccountBuilder connectionHolder(IConnectionHolder connectionHolder) {
            _model.setConnectionHolder(connectionHolder);
            return this;
        }

        public String dataSourceName() {
            return _model.getDataSourceName();
        }

        public WechatAccountBuilder dataSourceName(String dsName) {
            _model.setDataSourceName(dsName);
            return this;
        }

        public IShardingable shardingable() {
            return _model.getShardingable();
        }

        public WechatAccountBuilder shardingable(IShardingable shardingable) {
            _model.setShardingable(shardingable);
            return this;
        }

        public java.lang.String id() {
            return _model.getId();
        }

        public WechatAccountBuilder id(java.lang.String id) {
            _model.setId(id);
            return this;
        }

        public java.lang.String name() {
            return _model.getName();
        }

        public WechatAccountBuilder name(java.lang.String name) {
            _model.setName(name);
            return this;
        }

        public java.lang.String accountId() {
            return _model.getAccountId();
        }

        public WechatAccountBuilder accountId(java.lang.String accountId) {
            _model.setAccountId(accountId);
            return this;
        }

        public java.lang.String appId() {
            return _model.getAppId();
        }

        public WechatAccountBuilder appId(java.lang.String appId) {
            _model.setAppId(appId);
            return this;
        }

        public java.lang.String appSecret() {
            return _model.getAppSecret();
        }

        public WechatAccountBuilder appSecret(java.lang.String appSecret) {
            _model.setAppSecret(appSecret);
            return this;
        }

        public java.lang.String appAesKey() {
            return _model.getAppAesKey();
        }

        public WechatAccountBuilder appAesKey(java.lang.String appAesKey) {
            _model.setAppAesKey(appAesKey);
            return this;
        }

        public java.lang.String lastAppAesKey() {
            return _model.getLastAppAesKey();
        }

        public WechatAccountBuilder lastAppAesKey(java.lang.String lastAppAesKey) {
            _model.setLastAppAesKey(lastAppAesKey);
            return this;
        }

        public java.lang.String redirectUri() {
            return _model.getRedirectUri();
        }

        public WechatAccountBuilder redirectUri(java.lang.String redirectUri) {
            _model.setRedirectUri(redirectUri);
            return this;
        }

        public java.lang.String token() {
            return _model.getToken();
        }

        public WechatAccountBuilder token(java.lang.String token) {
            _model.setToken(token);
            return this;
        }

        public java.lang.Integer type() {
            return _model.getType();
        }

        public WechatAccountBuilder type(java.lang.Integer type) {
            _model.setType(type);
            return this;
        }

        public java.lang.Integer isVerified() {
            return _model.getIsVerified();
        }

        public WechatAccountBuilder isVerified(java.lang.Integer isVerified) {
            _model.setIsVerified(isVerified);
            return this;
        }

        public java.lang.Integer isDeleted() {
            return _model.getIsDeleted();
        }

        public WechatAccountBuilder isDeleted(java.lang.Integer isDeleted) {
            _model.setIsDeleted(isDeleted);
            return this;
        }

        public java.lang.Integer isDefault() {
            return _model.getIsDefault();
        }

        public WechatAccountBuilder isDefault(java.lang.Integer isDefault) {
            _model.setIsDefault(isDefault);
            return this;
        }

        public java.lang.Integer isMsgEncrypted() {
            return _model.getIsMsgEncrypted();
        }

        public WechatAccountBuilder isMsgEncrypted(java.lang.Integer isMsgEncrypted) {
            _model.setIsMsgEncrypted(isMsgEncrypted);
            return this;
        }

        public java.lang.Integer status() {
            return _model.getStatus();
        }

        public WechatAccountBuilder status(java.lang.Integer status) {
            _model.setStatus(status);
            return this;
        }

        public java.lang.String siteId() {
            return _model.getSiteId();
        }

        public WechatAccountBuilder siteId(java.lang.String siteId) {
            _model.setSiteId(siteId);
            return this;
        }

        public java.lang.String remark() {
            return _model.getRemark();
        }

        public WechatAccountBuilder remark(java.lang.String remark) {
            _model.setRemark(remark);
            return this;
        }

        public java.lang.Long createTime() {
            return _model.getCreateTime();
        }

        public WechatAccountBuilder createTime(java.lang.Long createTime) {
            _model.setCreateTime(createTime);
            return this;
        }

        public java.lang.Long lastModifyTime() {
            return _model.getLastModifyTime();
        }

        public WechatAccountBuilder lastModifyTime(java.lang.Long lastModifyTime) {
            _model.setLastModifyTime(lastModifyTime);
            return this;
        }

    }

    /**
     * WechatAccount 字段常量表
     */
    public class FIELDS {
        public static final String ID = "id";
        public static final String NAME = "name";
        public static final String ACCOUNT_ID = "account_id";
        public static final String APP_ID = "app_id";
        public static final String APP_SECRET = "app_secret";
        public static final String APP_AES_KEY = "app_aes_key";
        public static final String LAST_APP_AES_KEY = "last_app_aes_key";
        public static final String REDIRECT_URI = "redirect_uri";
        public static final String TOKEN = "token";
        public static final String TYPE = "type";
        public static final String IS_VERIFIED = "is_verified";
        public static final String IS_DELETED = "is_deleted";
        public static final String IS_DEFAULT = "is_default";
        public static final String IS_MSG_ENCRYPTED = "is_msg_encrypted";
        public static final String STATUS = "status";
        public static final String SITE_ID = "site_id";
        public static final String REMARK = "remark";
        public static final String CREATE_TIME = "create_time";
        public static final String LAST_MODIFY_TIME = "last_modify_time";
    }

    public static final String TABLE_NAME = "wechat_account";

}
